import { GET, POST } from "./xhr";

// 注册用户
export const fetchRegisterUser = async (data: any) =>
  await POST("/api/user/register", data);

// 用户登录
export const fetchLoginUser = async (data: any) =>
  await POST("/api/user/login", data);

// 请求所有用户
export const fetchAllUser = async () => await GET("/api/user/alluser");

// 注销
export const fetchLogout = async (data: any) =>
  await POST("/api/user/logout", data);

// 修改权限
export const fetchChangePermission = async (data: any) =>
  await POST("/api/user/modifypermission", data);

// 校验账号
export const fetchCheckUser = async (data: any) =>
  await POST("/api/user/checkuser", data);

// 修改密码
export const fetchChangePassword = async (data:any) => await POST("/api/user/changepassword", data);